﻿@model TestOnlineProject.Models.Entities.CustomTestModel
@using TestOnlineProject.Models.Entities
@{
    ViewBag.Title = "Edit";
}
<script type="text/javascript">

    $(document).ready(function () {
        // Expires datetime picker.
        $('#datetimepicker').datetimepicker();
    });

</script>
<div class="site_map">
    @Html.ActionLink("Home", "Index", "Home") / @Html.ActionLink("Subjects", "Index", "Subject")
    / <span style="word-wrap: break-word">@Html.ActionLink((ViewBag.Subject as Subject).Code, "Details", "Subject", new { id = (ViewBag.Subject as Subject).SubjectId }, null)</span>
    /
    @Html.ActionLink("Tests", "Index", "Test", new { subjectId = (ViewBag.Subject as Subject).SubjectId }, null)
    / Edit
</div>
<br />
<div class="main_nav">
    <span>
        <a href="@Url.Content("~/Test/Details")?id=@Model.TestId">
            <img src="@Url.Content("~/Images/back button.png")" style="height:30px"/>
        </a>
    </span>
</div>
<br />
<span class="require_info">(*) is required.</span>
<div class="classic_test">
    @using (Html.BeginForm())
    {
        @Html.HiddenFor(model => model.LastEditedTime)
        @Html.HiddenFor(model => model.SubjectId)
        @Html.HiddenFor(model => model.UserId)
        @Html.HiddenFor(model => model.TestTypeId)
        @Html.HiddenFor(model => model.TestId)
        @Html.HiddenFor(model => model.NumberOfQuestions)
        <input type="hidden" name="SectionId" id="SectionId" value="1" />
        <span class="errorMsg">@Html.ValidationSummary(true)</span>
        <table class="table table-bordered">
            <tr>
                <td style="width: 150px; text-align: right">
                    <span>Test Type</span>
                </td>
                <td>
                    <span>Classic</span>
                </td>
            </tr>
            <tr>
                <td style="width: 150px; text-align: right">
                    <span>Title (*)</span>
                </td>
                <td>
                    @Html.TextBoxFor(model => model.Title, new { })
                    <span class="errorMsg">@Html.ValidationMessageFor(model => model.Title)</span>
                </td>
            </tr>
            <tr>
                <td style="text-align: right">
                    <span>Expires (*)</span>
                </td>
                <td>
                    <div class="input-append date" id="datetimepicker" data-date="@Model.Expires" data-date-format="yyyy-mm-dd hh:ii"
                        data-link-field="Expires">
                        <input size="16" type="text" value="@Model.Expires" readonly style="width:150px; background-color:White" id="date_time"/>
                        <span class="add-on"><i class="icon-th"></i></span>
                    </div>
                    @Html.HiddenFor(model => model.Expires)
                    <span class="errorMsg">@Html.ValidationMessageFor(model => model.Expires)</span>
                </td>
            </tr>
            <tr>
                <td style="text-align: right">
                    Number of Questions
                </td>
                <td>
                    @Html.DisplayFor(model => model.NumberOfQuestions)
                </td>
            </tr>
            <tr>
                <td style="text-align: right">
                    Duration (minutes) (*)
                </td>
                <td>
                    @Html.TextBoxFor(model => model.Duration, new { style = "width:50px" })
                    <span class="errorMsg">@Html.ValidationMessageFor(model => model.Duration)</span>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <button type="submit" value="Save" class="btn" style="width: 80px">
                        Save</button>
                    @Html.ActionLink("Reset", "Edit", new { id = @Model.TestId }, new { @class = "btn", style = "width:54px" })
                    @Html.ActionLink("Cancel", "Details", "Test", new { id = @Model.TestId }, new { @class = "btn", style = "width:54px" })
                </td>
            </tr>
        </table>
                            
    }
</div>
